﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Lambda表达式案例5
{
    //委托  逛超市
    delegate int GuangChaoshi(int a);
    public class Program
    {
        #region 委托
        //static void Main(string[] args)
        //{
        //    GuangChaoshi gwl = JieZhang;
        //    Console.WriteLine(gwl(10) + "");   //打印20，委托的应用
        //    Console.ReadKey();
        //}

        ////结账
        //public static int JieZhang(int a)
        //{
        //    return a + 10;
        //}
        #endregion
        #region Lambda表达式
        //委托  逛超市
        delegate int GuangChaoshi(int a);
        static void Main(string[] args)
        {
            // GuangChaoshi gwl = JieZhang;
            GuangChaoshi gwl = p => p + 10;
            Console.WriteLine(gwl(10) + "");   //打印20，表达式的应用
            Console.ReadKey();
        }
        #endregion
    }


}
